package com.example.administrator.testservice;


import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class Mp3Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mp3);

       // mp3Path="/sdcard/mp3/";
    }
    public void play(View view) throws  Exception{
        Intent intent=new Intent();

      //  intent.setClass(this,MusicService.class);
        intent.putExtra("action","play");
        intent.setAction("music");
        intent.setPackage(this.getPackageName());
        startService(intent);

    }
    public void pause(View view) throws  Exception{
        Intent intent=new Intent();
     //   intent.setClass(this,MusicService.class);
        intent.putExtra("action","pause");
        intent.setAction("music");
        intent.setPackage(this.getPackageName());
        startService(intent);
    }
}
